package com.pro.api;
import com.pro.dto.Dto;
import com.pro.service.CourseCategoryService;
import com.pro.util.dtoUtil.DtoUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/***
 *
 * CourseCategory控制层
 *
 */

@RestController
@RequestMapping("courseCategory")
public class CourseCategoryController {
    @Autowired
    private CourseCategoryService courseCategoryService;

    /***
     *
     * 查询二级分类列表
     */
    @GetMapping("categoryLevel2")
    public Dto categoryLevel2(){
        return DtoUtil.returnSuccess(courseCategoryService.selCategoryLevel2());
    }

    /***
     *
     * 查询三级分类列表
     */
    @GetMapping("categoryLevel3")
    public Dto categoryLevel3(int parentId){
        return DtoUtil.returnSuccess(courseCategoryService.selCategoryLevel3(parentId));
    }
}
